import 'package:flutter/material.dart';

// ignore: must_be_immutable
class CardItem extends StatelessWidget {
  String imgSrc;
  String title;
  String subtitle;
  CardItem({
    this.imgSrc:
        'http://p2.music.126.net/wHzdZwKe0jQthTUJnNzwbg==/109951165267995750.jpg',
    this.title: '一级标题',
    this.subtitle: '二级标题',
  });
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Container(
        // height: 1000,
        child: Card(
          margin: EdgeInsets.all(5),
          child: Column(
            children: [
              AspectRatio(
                aspectRatio: 4 / 3,
                child: Image.network(this.imgSrc, fit: BoxFit.cover),
              ),
              ListTile(
                title: Text(this.title, overflow: TextOverflow.clip),
                subtitle: Text(
                  this.subtitle,
                  overflow: TextOverflow.clip,
                ),
                // leading: ClipOval(
                //   child: Image.network(this.imgSrc),
                // ),
                leading: CircleAvatar(
                  backgroundImage: NetworkImage(this.imgSrc),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
